const Mock = require('mockjs')

module.exports = {
  devServer: {
    before(app) {
      app.get('/api/list', (req, res) => {
        const data = Mock.mock({
          "list|10": [{
            url: "@image(120x80, @color)",
            "title": "@ctitle",
            "desc": "@cword(10, 20)",
            "id":"@id"
          }]
        })
        res.send({
          code: 200,
          data: data.list
        })
      })
    }
  }
}